package org.libraq.basic.util;

import lombok.Data;

@Data
public class AjaxResult {
    private Boolean success = true;
    private String msg;

    //有时除了返回成功或者失败和提示信息，有可能还要往前提返回一些数据，再加一个数据来属性
    private Object resultObj;


    public static AjaxResult me(){
        return new AjaxResult();
    }

    public AjaxResult setSuccess(Boolean success){
        this.success = success;//为当前对象重新赋值
        return this;//返回值：当前对象
    }

    public AjaxResult setMsg(String msg){
        this.msg = msg;
        return this;
    }

    public AjaxResult setResultObj(Object resultObj){
        this.resultObj = resultObj;
        return this;
    }
    public AjaxResult(Boolean success, String msg) {
        this.success = success;
        this.msg = msg;
    }

    public AjaxResult() {
    }
}
